package com.xucia.jsponic.datasource;

import java.io.IOException;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

import org.apache.commons.httpclient.HttpException;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.Scriptable;

import com.xucia.jsponic.data.ObjectId;
import com.xucia.jsponic.data.PersistableImpl;
import com.xucia.jsponic.data.PersistableList;
import com.xucia.jsponic.data.LazyPropertyId;
import com.xucia.jsponic.remote.ClientConnection;
import com.xucia.jsponic.remote.JsponReceiver;
import com.xucia.jsponic.remote.JsponSender;

public abstract class AbstractJsponSource extends JsponReceiver implements DataSource {
	Object SOURCE_URL_KEY = new Object();
	Object ACCESS_LEVEL_MAP_KEY = new Object();
	boolean trustJavaScript = false;
	/**
	 * Gets the JSPON string for a particular object id. This is called when an object needs to be initialized, 
	 * and this AbstractJsponSource/JsponReceiver will handle the conversion of the JSPON
	 * string to an object 
	 * @param objectId
	 * @return the JSPON string
	 * @throws Exception
	 */
	protected abstract String getJsponString(String objectId) throws Exception;

	String id;
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
		
	}
}
